
package com.onlyxiahui.common.data.common.builder;

import com.onlyxiahui.common.data.base.HeadImpl;

/**
 * Description <br>
 * Date 2021-03-12 11:12:42<br>
 * 
 * @author XiaHui [onlovexiahui@qq.com]<br>
 * @since 1.0.0
 */

public class HeadBuilder {

	public static HeadImpl build(String key, String action, String method) {
		HeadImpl head = new HeadImpl();
		head.setAction(action);
		head.setMethod(method);
		head.setKey(key == null || key.trim().isEmpty() ? NanosecondKeyGet.nanosecondKey() : key);
		head.setTimestamp(System.currentTimeMillis());
		return head;
	}

	public static HeadImpl build(String action, String method) {
		return build(null, action, method);
	}
}
